
<!-- Product -->
<div xmlns="http://www.w3.org/1999/xhtml" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:gr="http://purl.org/goodrelations/v1#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:v="http://rdf.data-vocabulary.org/#"
xmlns:review="http://purl.org/stuff/rev#"
{% for prefix in prefixes %}
xmlns:{{prefix.ns_prefix}}="{{prefix.ns_uri}}"
{% endfor %}
>
	<div about="{{product_uri}}#offer_data" typeof="gr:Offering">
		<div rel="foaf:maker" resource="{{maker}}"></div>
		<div property="gr:name" content="{{product_name}}" xml:lang="{{language}}"></div>
		<div property="gr:description" content="{{product_short}}" xml:lang="{{language}}"></div>
		<div property="rdfs:comment" content="{{product_long}}" xml:lang="{{language}}"></div>
		<div rev="gr:offers" resource="{{company_uri}}"></div>
		<div rel="gr:hasBusinessFunction" resource="{{business_function}}"></div>
{% if product_special_price > 0 %}
		<div rel="gr:hasPriceSpecification">
			<div typeof="gr:UnitPriceSpecification" about="{{product_uri}}#price_data">
				<div property="gr:name" content="Discounted price" datatype="xsd:string"></div>
				<div property="gr:hasCurrency" content="{{currency}}" datatype="xsd:string"></div>
				<div property="gr:hasCurrencyValue" content="{{product_special_price}}" datatype="xsd:float"></div>
				<div property="gr:hasUnitOfMeasurement" content="C62" datatype="xsd:string"></div>
				<div property="gr:valueAddedTaxIncluded" content="{{vat}}" datatype="xsd:boolean"></div>
{% if product_special_start_date  %}
				<div property="gr:validFrom" datatype="xsd:dateTime" content="{{product_special_start_datestring}}"></div>
{% endif %}
{% if product_special_end_date %}
{% if product_special_start_date < product_special_end_date  %}
				<div property="gr:validThrough" datatype="xsd:dateTime" content="{{product_special_end_datestring}}"></div>
{% endif %}
{% else %}
				<div property="gr:validThrough" datatype="xsd:dateTime" content="{{product_special_end_date_default}}"></div>
{% endif %}
{% if price_quantity_start %}
				<div rel="gr:hasEligibleQuantity">
					<div typeof="gr:QuantitativeValueInteger" about="{{product_uri}}#eligiblequantity">
						<div property="gr:hasMinValueInteger" datatype="xsd:int" content="{{price_quantity_start}}"></div>
{% if price_quantity_end %}
						<div property="gr:hasMaxValueInteger" datatype="xsd:int" content="{{price_quantity_end}}"></div>
{% endif %}
					</div>
				</div>
{% else %}
{% if price_quantity_end %}
				<div rel="gr:hasEligibleQuantity">
					<div typeof="gr:QuantitativeValueInteger" about="{{product_uri}}#eligible_quantity">
						<div property="gr:hasMaxValueInteger" datatype="xsd:int" content="{{price_quantity_end}}"></div>
					</div>
				</div>
{% endif %}
{% endif %}
			</div>
		</div>
{% else %}
{% if price > 0 %}
		<div rel="gr:hasPriceSpecification">
			<div typeof="gr:UnitPriceSpecification" about="{{product_uri}}#price_data">
				<div property="gr:name" content="Standard price" datatype="xsd:string"></div>
				<div property="gr:hasCurrency" content="{{currency}}" datatype="xsd:string"></div>
				<div property="gr:hasCurrencyValue" content="{{price}}" datatype="xsd:float"></div>
				<div property="gr:hasUnitOfMeasurement" content="C62" datatype="xsd:string"></div>
				<div property="gr:valueAddedTaxIncluded" content="{{vat}}" datatype="xsd:boolean"></div>
				<div property="gr:validFrom" datatype="xsd:dateTime" content="{{valid_from}}"></div>
{% if valid_through %}
				<div property="gr:validThrough" datatype="xsd:dateTime" content="{{valid_through}}"></div>
{% endif %}
{% if price_quantity_start %}
				<div rel="gr:hasEligibleQuantity">
					<div typeof="gr:QuantitativeValueInteger" about="{{product_uri}}#eligible_quantity">
						<div property="gr:hasMinValueInteger" datatype="xsd:int" content="{{price_quantity_start}}"></div>
{% if price_quantity_end %}
						<div property="gr:hasMaxValueInteger" datatype="xsd:int" content="{{price_quantity_end}}"></div>
{% endif %}
					</div>
				</div>
{% else %}
{% if price_quantity_end %}
				<div rel="gr:hasEligibleQuantity">
					<div typeof="gr:QuantitativeValueInteger" about="{{product_uri}}#eligible_quantity">
						<div property="gr:hasMaxValueInteger" datatype="xsd:int" content="{{price_quantity_end}}"></div>
					</div>
				</div>
{% endif %}
{% endif %}
{% endif %}
			</div>
		</div>
{% endif %}
{% for delivery_option in delivery_options %}
		<div rel="gr:availableDeliveryMethods" resource="{{delivery_option}}"></div>
{% endfor %}
{% for customer_type in customer_types %}
		<div rel="gr:eligibleCustomerTypes" resource="{{customer_type}}"></div>
{% endfor %}
		<div property="gr:validFrom" datatype="xsd:dateTime" content="{{valid_from}}"></div>
{% if valid_through %}
		<div property="gr:validThrough" datatype="xsd:dateTime" content="{{valid_through}}"></div>
{% endif %}
{% for region in eligible_regions %}
		<div property="gr:eligibleRegions" datatype="xsd:string" content="{{region}}"></div>
{% endfor %}
{% for payment_method in payment_methods %}
		<div rel="gr:acceptedPaymentMethods" resource="{{payment_method}}"></div>
{% endfor %}
{% for warranty_promise in warranty_promises %}
		<div rel="gr:hasWarrantyPromise">
			<div typeof="gr:WarrantyPromise" about="{{warranty_promise.uri}}">
				<div rel="gr:hasWarrantyScope" resource="{{warranty_promise.scope}}"></div>
				<div property="gr:durationOfWarrantyInMonths" datatype="xsd:int" content="{{warranty_promise.duration}}"></div>
			</div>
		</div>
{% endfor %}
{% if sku %}
		<div property="gr:hasStockKeepingUnit" content="{{sku}}" datatype="xsd:string"></div>
{% endif %}
{% if stock_level %}
		<div rel="gr:hasInventoryLevel">
			<div about="{{product_uri}}#inventory_level" typeof="gr:QuantitativeValue">
				<div property="gr:hasUnitOfMeasurement" content="{{stock_unit}}" datatype="xsd:string"></div>
				<div property="gr:hasMinValue" content="{{stock_level}}" datatype="xsd:float"></div>
			</div>
		</div>
{% endif %}
		<div rel="foaf:page" resource="{{product_uri}}"></div>
{% if minimal %}
{% else %}
		<div rel="gr:includesObject">
			<div typeof="gr:TypeAndQuantityNode" about="{{product_uri}}#taqn">
				<div property="gr:amountOfThisGood" content="1.0" datatype="xsd:float"></div>
				<div property="gr:hasUnitOfMeasurement" content="C62" datatype="xsd:string"></div>
				<div rel="gr:typeOfGood">
					<div about="{{product_uri}}#product_data" typeof="{{product_type}} {{category_uri}}">
						<div property="gr:name" content="{{product_name}}" xml:lang="{{language}}"></div>
						<div property="gr:description" content="{{product_short}}" xml:lang="{{language}}"></div>
						<div property="rdfs:comment" content="{{product_long}}" xml:lang="{{language}}"></div>
{% for uri in product_image_uris %}
						<div rel="foaf:depiction" resource="{{uri}}"></div> 
{% endfor %}
{% for uri in product_thumbnail_uris %}
						<div rel="foaf:thumbnail" resource="{{uri}}"></div>
{% endfor %}
{% if ean %}
						<div property="gr:hasEAN_UCC-13" content="{{ean}}" datatype="xsd:string"></div>
{% endif %}
{% if gtin14 %}
						<div property="gr:hasGTIN-14" content="{{gtin14}}" datatype="xsd:string"></div>
{% endif %}
{% if sku %}
						<div property="gr:hasStockKeepingUnit" content="{{sku}}" datatype="xsd:string"></div>
{% endif %}
{% if manufacturer_uri %}
						<div rel="gr:hasManufacturer" resource="{{manufacturer_uri}}"></div>
{% endif %}
{% if datasheet_uri %}
						<div rel="gr:hasMakeAndModel" resource="{{datasheet_uri}}"></div>
{% endif %}
						<div rel="foaf:page" resource="{{product_uri}}"></div>
{% if stock_unit %}
{% if stock_level %}
						<div rel="gr:hasInventoryLevel" resource="{{product_uri}}#inventory_level"></div>
{% endif %}
{% endif %}
{% if product_class_uri %}
						<div rel="rdf:type" resource="{{product_class_uri}}"></div>
{% endif %}
{% for feature in features %}
{% if feature.type == "text" %}
						<div property="{{feature.uri}}" content="{{feature.value}}" xml:lang="{{feature.language}}"></div>
{% endif %}
{% if feature.type == "boolean" %}
						<div property="{{feature.uri}}" content="{{feature.value}}" datatype="xsd:boolean"></div>
{% endif %}
{% if feature.type == "quantitative" %}
{% if feature.datatype == "float" %}
						<div rel="{{feature.uri}}">
							<div typeof="gr:QuantitativeValue" about="{{product_uri}}#{{feature.name}}">
								<div property="gr:hasUnitOfMeasurement" content="{{feature.unit_code}}" datatype="xsd:string"></div>
{% if feature.value %}
								<div property="gr:hasValue" content="{{feature.value}}" datatype="xsd:float"></div>
								<div property="gr:name" xml:lang="en" content="{{feature.name}} description for {{product_name}}"></div>
								<div property="gr:description" xml:lang="en" content="{{product_name}} has a {{feature.name}} of {{feature.value}} {{feature.unit_code}}"></div>
{% else %}
{% if feature.min_value %}
								<div property="gr:hasMinValue" content="{{feature.min_value}}" datatype="xsd:float"></div>
{% endif %}
{% if feature.max_value %}
								<div property="gr:hasMaxValue" content="{{feature.max_value}}" datatype="xsd:float"></div>			
{% endif %}
{% endif %}
							</div>
						</div>
{% endif %}
{% endif %}
{% if feature.type == "quantitative" %}
{% if feature.datatype == "integer" %}
						<div rel="{{feature.uri}}">
							<div typeof="gr:QuantitativeValue" about="{{product_uri}}#{{feature.name}}">
								<div property="gr:hasUnitOfMeasurement" content="{{feature.unit_code}}" datatype="xsd:string"></div>
{% if feature.value %}
								<div property="gr:hasValue" content="{{feature.value}}" datatype="xsd:int"></div>
								<div property="gr:name" xml:lang="en" content="{{feature.name}} description for {{product_name}}"></div>
								<div property="gr:description" xml:lang="en" content="{{product_name}} has a {{feature.name}} of {{feature.value}} {{feature.unit_code}}"></div>
{% else %}
{% if feature.min_value %}
								<div property="gr:hasMinValue" content="{{feature.min_value}}" datatype="xsd:int"></div>
{% endif %}
{% if feature.max_value %}
								<div property="gr:hasMaxValue" content="{{feature.max_value}}" datatype="xsd:int"></div>			
{% endif %}
{% endif %}
							</div>
						</div>
{% endif %}
{% endif %}
{% if feature.type == "qualitative" %} 
						<div rel="{{feature.uri}}" resource="{{feature.value_uri}}"></div>
{% endif %}
{% endfor %}
					</div>
				</div>
			</div>
		</div>
{% endif %}
